package com.team.appinfo.service.impl;

import com.team.appinfo.entity.DevUser;
import com.team.appinfo.entity.DevUserExample;
import com.team.appinfo.mapper.DevUserMapper;
import com.team.appinfo.service.DevUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevUserServiceImpl implements DevUserService {

    @Autowired
    private DevUserMapper devUserMapper;

    @Override
    public DevUser login(String uresname, String password) {
        DevUserExample due=new DevUserExample();
        DevUserExample.Criteria criteria = due.createCriteria();
        criteria.andDevcodeEqualTo(uresname);
        criteria.andDevpasswordEqualTo(password);

        List<DevUser>list=this.devUserMapper.selectByExample(due);
   if (list!=null&&list.size()==1){
       return list.get(0);
   }
        return null;
    }
}
